import request from '@/utils/request'

// 查询报名列表
export function listRegistration(query) {
  return request({
    url: '/training/registration/list',
    method: 'get',
    params: query
  })
}

// 新增报名
export function addRegistration(data) {
  return request({
    url: '/training/registration',
    method: 'post',
    data: data
  })
}

// 修改报名
export function updateRegistration(data) {
  return request({
    url: '/training/registration',
    method: 'put',
    data: data
  })
}

// 删除报名
export function delRegistration(registrationId) {
  return request({
    url: '/training/registration/' + registrationId,
    method: 'delete'
  })
}


// 查询报名详细
export function getRegistration(registrationId) {
  return request({
    url: '/training/registration/' + registrationId,
    method: 'get'
  })
}


//列表数据
export function registrationList(query) {
  return request({
    url: '/training/registration/registrationList',
    method: 'get',
    params: query
  })
}

//新增个人
export function addPerson(data) {
  return request({
    url: '/training/registration/add',
    method: 'post',
    data: data
  })
}

//修改
export function updateInfo(data) {
  return request({
    url: '/training/registration/update',
    method: 'put',
    data: data
  })
}

//删除
export function deleteInfo(registrationId) {
  return request({
    url: '/training/registration/removeRegistration/' + registrationId,
    method: 'delete'
  })
}


//新增集体
export function addGroup(data) {
  return request({
    url: '/training/registration/addGroup',
    method: 'post',
    data: data
  })
}

//导出申请表
export function exportData(data) {
  return request({
    url: '/training/registration/export/applicationForm',
    method: 'post',
    data: data
  })
}
// export function exportData(registrationIds) {
//   return request({
//     url: '/training/registration/export/applicationForm/' + registrationIds,
//     method: 'post'
//   })
// }

// 查询培训进度
export function listTrainingProgress(studentId) {
  return request({
    url: '/training/registration/trainingProgress/' + studentId,
    method: 'get'
  })
}
